import request from "@/utils/requestUtils";
import {getApiUrl} from "@/api/apiUrl";

let url_pre = getApiUrl()

export function loginRequest(option) {
	let url = url_pre + '/user/login'
	return request({
		url: url,
		method: 'post',
		data:option,
		// data默认为application/json类型
		headers: {
			'Content-Type': 'application/json'
		}
	})
}

export function changeAccount(option) {
	let url = url_pre + '/user/account'
	return request({
		url: url,
		method: 'post',
		data: option,
	})
}

// export function addAccount(option) {
// 	let url = url_pre + '/user/account'
// 	return request({
// 		url: url,
// 		method: 'post',
// 		data: option,
// 	})
// }
// 查询所有子账户
export function accountList(uid) {
	let url = url_pre + '/user/account?uid=' + uid
	return request({
		url: url,
		method: 'get',
		headers: {
			'Content-Type': 'application/json'
		}
	})
}

// export function accountInfo(userMap) {
// 	let url = url_pre + '/user/accountInfo'
// 	return request({
// 		url: url,
// 		method: 'post',
// 		data: userMap,
// 		headers: {
// 			'Content-Type': 'application/json'
// 		}
// 	})
// }
